from transformers import pipeline

classifier = pipeline(
    task="ner",
    model=r"/opt/model/roberta-base-finetuned-dianping-chinese", # 中文实体识别优化，精度高
    device="cpu"
)

result = classifier("Hugging Face is a French company based in New York City.")
print("ner：", result)